﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace SCMS.UI.Models
{

    public class ChooseR4AdvanceType
    {
        [Required(ErrorMessage = "Please Choose Advance request type")]
        public string R4AType { get; set; }
    }

    public class Request4Advance
    {
        public Model.AdvanceRequest EntityAdvanceRqst { get; set; }

        [Required(ErrorMessage = "Required Field")]
        public Guid ReferenceIdPo { get; set; }

        public DateTime? PreparedOn { get { return (DateTime)EntityAdvanceRqst.RequestDate; } set { EntityAdvanceRqst.RequestDate = (DateTime)value; } }

        [Required(ErrorMessage = "Must be a value")]
        public decimal TotalPayment { get { return (decimal)EntityAdvanceRqst.TotalAdvance; } set { EntityAdvanceRqst.TotalAdvance = value; } }

        public string Reason4Payment { get { return EntityAdvanceRqst.Subject; } set { EntityAdvanceRqst.Subject = value; } }

        public string Remarks { get { return EntityAdvanceRqst.Remarks; } set { EntityAdvanceRqst.Remarks = value; } }

        [Required(ErrorMessage = "Supplier is required")]
        public Guid StaffId { get { return (Guid)EntityAdvanceRqst.PaidTo; } set { EntityAdvanceRqst.PaidTo = value; } }
        public SelectList StaffList { get; set; }

        [Required(ErrorMessage = "Payment Term is required")]
        public Guid PaymentTermId { get { return (Guid)EntityAdvanceRqst.PaymentTermId; } set { EntityAdvanceRqst.PaymentTermId = value; } }
        public SelectList PaymentTerms { get; set; }

        [Required(ErrorMessage = "Currency is required")]
        public Guid CurrencyId { get { return (Guid)EntityAdvanceRqst.CurrencyId; } set { EntityAdvanceRqst.CurrencyId = value; } }
        public SelectList Currencies { get; set; }

        [Display(Name = "Payment Type")]
        public Guid PaymentTypeId { get { return (Guid)EntityAdvanceRqst.PaymentTypeId; } set { EntityAdvanceRqst.PaymentTypeId = value; } }
        public SelectList Paymenttype { get; set; }

        public string UniqueNo { get { return EntityAdvanceRqst.RefNumber; } set { EntityAdvanceRqst.RefNumber = value; } }

        [Required(ErrorMessage = "Unique No is required")]
        public string RefNumber { get { return EntityAdvanceRqst.RefNumber; } set { EntityAdvanceRqst.RefNumber = value; } }
        public SelectList dropdownlist { get; set; }

        public List<PaymentDetails> paymentdetailz { get; set; }

        public string usermsg { get; set; }

        public bool IsSaved { get; set; }
    }

    public class PaymentDetails
    {
        public decimal Amount { get; set; }

        public string BudgetLine { get; set; }
        public Guid BudgetLineId { get; set; }

        public string projectNo { get; set; }
        public Guid PorjectNoId { get; set; }
    }

    public class ViewR4Advance
    {
        public Model.AdvanceRequest EntityAdvanceRqst { get; set; }

        public List<PaymentDetails> paymentDetais { get; set; }

    }

    public class RejectRFA
    {
        [Required]
        public Guid Id { get; set; }

        public string RefNumber { get; set; }

        [Required(ErrorMessage = "Remarks are required.")]
        public string RejectedAuthRemarks { get; set; }

        [Required(ErrorMessage = "Remarks are required.")]
        public string RejectedReviewRemarks { get; set; }

        public bool IsReview { get; set; }
    }
}